<!DOCTYPE html>
<html>

<head>
    <base href="/">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>专业</title>

    <link href="plugins/switchery/dist/switchery.min.css" rel="stylesheet" />
    <link href="plugins/bootstrap-table/dist/bootstrap-table.min.css" rel="stylesheet" type="text/css" />
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!-- select2 css -->
    <link href="plugins/select2/css/select2.css" rel="stylesheet" type="text/css" />
    <link href="plugins/bootstrap-select/dist/css/bootstrap-select.min.css" rel="stylesheet" />
    <!-- 公共css -->
    <link href="css/core.css" rel="stylesheet" type="text/css" />
    <link href="css/components.css" rel="stylesheet" type="text/css" />
    <link href="css/icons.css" rel="stylesheet" type="text/css" />
    <link href="css/pages.css" rel="stylesheet" type="text/css" />
    <link href="css/responsive.css" rel="stylesheet" type="text/css" />

    <!-- HTML5 Shiv and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->

    <style>
        .select2-selection .select2-selection--single {
            height: 38px;
        }
        /*不带搜索框的下拉框容器*/

        .select-container .btn-white {
            border: 1px solid #E3E3E3 !important;
            padding: 9px 12px;
        }
    </style>
    <script src="js/modernizr.min.js"></script>

</head>

<body class="fixed-left">

<div class="container">
    <div class="card-box">
        <!--===================================================-->
        <br>
        <div class="row">
            <div class="col-sm-12">

                <h4 class="m-t-0 header-title m-b-10"><b>毕昇杯报名列表</b></h4>

                <div class="accordion-group">
                    <div id="collapse-search" class="accordion-body collapse">
                        <div class="accordion-inner">
                            <form id="search-form" modelAttribute="labTeachProject" class="form form-horizontal well clearfix">
                                <div class="row">






                                    <div class="col-xs-3 col-sm-3 col-md-3">
                                        <div class="form-group">
                                            <label for="schoolname" class="col-sm-3 control-label">学校</label>
                                            <div class="col-sm-8">
                                                <input name="schoolname" id="schoolname"  htmlEscape="false" maxlength="64" class="form-control" />
                                            </div>
                                        </div>

                                    </div>

                                    <div class="col-xs-3 col-sm-3 col-md-3">
                                        <div class="form-group">
                                            <label for="yuanxi" class="col-sm-3 control-label">学院</label>
                                            <div class="col-sm-8">
                                                <input name="yuanxi" id="yuanxi"  htmlEscape="false" maxlength="64" class="form-control" />
                                            </div>
                                        </div>

                                    </div>



                                    <div class="col-xs-3 col-sm-3 col-md-3">
                                        <div class="form-group">
                                            <label for="fuzerenname" class="col-sm-3 control-label">参赛选手</label>
                                            <div class="col-sm-8">
                                                <input name="fuzerenname" id="fuzerenname"  htmlEscape="false" maxlength="64" class="form-control" />
                                            </div>
                                        </div>

                                    </div>

                                    <div class="col-xs-3 col-sm-3 col-md-3">
                                        <div class="form-group">
                                            <label for="teachername" class="col-sm-3 control-label">指导老师</label>
                                            <div class="col-sm-8">
                                                <input name="teachername" id="teachername"  htmlEscape="false" maxlength="64" class="form-control" />
                                            </div>
                                        </div>

                                    </div>




                                    <div class="col-xs-4 col-sm-4 col-md-4">
                                        <div style="margin-top:26px">
                                            <button id="search" type="button" class="btn btn-white" onclick="lab.searchTable();"><i
                                                    class="fa fa-search"></i> 查询
                                            </button>
                                            <button id="reset" type="reset" class="btn btn-white" onclick="lab.resetTable();"><i
                                                    class="fa fa-refresh"></i> 重置
                                            </button>
                                        </div>
                                    </div>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>

                <div id="buttons-toolbar" class="button-list">

                  <!--  <button id="btn-export" class="btn btn-info" onclick="lab.export('#search-form', 'exportList')">
                        <i class="ti-export m-r-5"></i>导出
                    </button>-->

                    <a class="accordion-toggle btn btn-default" data-toggle="collapse" data-parent="#accordion2" href="#collapse-search">
                        <i class="fa fa-search"></i> 检索条件
                    </a>
                </div>
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>
<!-- container -->

<script>
    var resizefunc = [];
</script>

<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>


<script src="js/jquery.core.js"></script>

<script src="plugins/layer/layer.js"></script>
<script src="plugins/switchery/dist/switchery.min.js"></script>
<script src="js/global.js"></script>

<script src="plugins/bootstrap-table/dist/bootstrap-table.min.js"></script>
<script src="plugins/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="js/bootstrap-table-defaults.js"></script>



<script>
    $(document).ready(function() {

        $('#bootstrap-table').bootstrapTable({
            url:  '/selectallbaoming',
            columns: [

                {
                    field: 'schoolname',  align: 'center',
                    title: '学校'
                },
                {
                    field: 'yuanxi',  align: 'center',
                    title: '学院'
                },


                {
                    field: 'fuzerenname',  align: 'center',
                    title: '参赛选手'
                },

                {
                    field: 'phone',  align: 'center',
                    title: '参赛选手联系方式'
                },
                {
                    field: 'weixin',  align: 'center',
                    title: '参赛选手微信或Email'
                },




                {
                    field: 'teachername',  align: 'center',
                    title: '指导老师'
                },

                {
                    field: 'teacherphine',  align: 'center',
                    title: '指导老师联系方式'
                },

                {
                    field: 'teacheremail',  align: 'center',
                    title: '指导老师微信或Emai'
                },


                {
                    field: 'timu',  align: 'center',
                    title: '参赛作品名称'
                },


                {
                    title: '状态',  align: 'center',

                    formatter: function(value, row, index) {

                        if(row.status==1){

                            return '<span>已通过</span>';
                        }else      if(row.status==0){

                            return '<span>未审核</span>';

                        }

                        else     {

                            return '<span>不通过</span>';

                        }


                    }
                },

                /*

                                {
                                    title: '结束使用时间',  align: 'center',

                                    formatter: function(value, row, index) {

                                        if(row.endTime==null){

                                            return '<span>' + '</span>';
                                        }else{

                                            return '<span>' + new Date(row.endTime).Format("yyyy-MM-dd hh:mm") + '</span>';

                                        }



                                    }
                                },
                */



                {
                    title: '操作',
                    formatter: function (value, row, index) {



                        if(row.status==0){


                            return     '<button type="button" onclick="shenhetg(\'' + row.id + '\');" class="btn btn-primary">审核通过</button>'+

                                '<button type="button" onclick="shenhebohui(\'' + row.id + '\');" class="btn btn-danger">不通过</button>'+


                                '<button type="button" onclick="viewDetails(\'' + row.id + '\');" class="btn btn-info">查看详情</button>';



                        }else    {



                            return       '<button type="button" onclick="viewDetails(\'' + row.id + '\');" class="btn btn-info">查看详情</button>';


                        }









                    }

                }




            ],
            toolbar: '#buttons-toolbar'
        });
        lab.initTableBtn();
    });


    function viewDetails(id) {
        // 跳转到详情页面 xiangqing.html，并传递用户ID参数
        window.location.href = '/xiangqing?id=' + id;
    }

    function shenhetg(id) {
        // 使用 confirm 弹窗进行审核确认
        var result = confirm("确定审核通过吗？");
        if (result) {
            // 发起审核请求
            $.ajax({
                type: 'POST',
                url: '/shenhetongguo', // 根据您的实际接口地址进行修改
                data: { id: id },
                success: function (response) {
                    // 刷新页面
                    location.reload();
                },
                error: function (xhr, status, error) {
                    console.error("审核请求失败: " + error);
                }
            });
        }
    }





    function shenhebohui(id) {
        // 使用 confirm 弹窗进行审核确认
        var result = confirm("确定不通过吗？");
        if (result) {
            // 发起审核请求
            $.ajax({
                type: 'POST',
                url: '/shenhebohui', // 根据您的实际接口地址进行修改
                data: { id: id },
                success: function (response) {
                    // 刷新页面
                    location.reload();
                },
                error: function (xhr, status, error) {
                    console.error("审核请求失败: " + error);
                }
            });
        }
    }


</script>
</body>

</html>